<?php
/*
* Kusht Mud.
* ----
* The MIT License
* Copyright (c) 2010 Andrew Tutt
* ----
*/

/* UserCharacter Class
*
* This is the Game Object for a User Character adding User-Relevant 
* Functionality to the Character class
*
*/

require_once "Character.class.inc";

class UserCharacter extends Character {
	public $owner_id;	/* This is the User's Owner's Account */
	public $connector; 	/* This is the User's Connector  */
	
	public $logon;				// When it happened
	public $save_time;			// Last time save happened (we will autosave of course)
	public $prompt;				// User custom prompt
	
	/* -- LOW LEVEL FUNCTIONS -- */
	
	function send($msg) {
		$numargs = func_num_args();
		
		// This is for Creating a standard Method of Prettying Output
		if ($numargs == 2) { 
			$special_type = func_get_arg(1);
			$msg = strPackager::package($msg,$special_type);
			$this->connector->send($msg);
		} else {	
			$msg = strPackager::package($msg,GENERAL_MSG);
			$this->connector->send($msg);
		}
	}
	
	function send_data($data) {
		$this->connector->send(strPackager::encodeBuffer($data));
	}
	
	function loadClient() {
		clientHandler::load($this);
	}	
}

?>